<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="span[@type='element']">
		<tag name="element">
			<parameter name="expression" value="{./@expression}" />
		</tag>
	</xsl:template>
	
	<xsl:template match="span[@type='loop']">
		<tag name="loop">
			<parameter name="loopExpression">
				<xsl:value-of select="./@expression" />
			</parameter>
			<body>
				<xsl:apply-templates select="span" />
			</body>
		</tag>
	</xsl:template>
	
	<xsl:template match="span[@type='expression']">
		<tag name="expression">
			<parameter name="expression" value="{input/@value}" />
		</tag>
	</xsl:template>
	
	<xsl:template match="span[@type='condition']">
		<tag name="condition">
			<parameter name="condition" value="{./@expression}" >
				<xsl:value-of select="input/@value" />
			</parameter>
			<ifbody>
				<xsl:apply-templates select="span" />
			</ifbody>
			<elsebody></elsebody>
		</tag>
	</xsl:template>
</xsl:stylesheet>